package com.kun.valiant.activity.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.kun.valiant.common.annotation.Excel;
import com.kun.valiant.common.core.domain.BaseEntity;
import com.kun.valiant.common.validator.CreateGroup;
import com.kun.valiant.common.validator.EditGroup;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @author fangkun
 * @create 2023-06-05-11:21
 */
public class ActivityVO extends BaseEntity {

    /**
     * 活动ID
     */
    @Excel(name = "活动ID")
    @NotNull(message = "活动id不能为空",groups = EditGroup.class)
    private Long activityId;

    /**
     * 活动名称
     */
    @Excel(name = "活动名称")
    @NotBlank(message = "{activity.name.notBlank}",groups = {CreateGroup.class,EditGroup.class})
    private String name;

    /**
     * 渠道ID
     */
    @NotNull(message = "渠道id不能为空",groups = {CreateGroup.class,EditGroup.class})
    private Long channelId;

    @Excel(name = "渠道名称")
    private String channelName;

    /**
     * 活动简介
     */
    @Excel(name = "活动简介")
    @NotBlank(message = "活动简介不能为空",groups = {CreateGroup.class,EditGroup.class})
    private String info;

    /**
     * 活动类型 1 折扣券 2 代金券
     */
    @Excel(name = "活动类型", readConverterExp = "1=折扣券,2=代金券")
    @NotNull(message = "活动类型不能为空",groups = {CreateGroup.class,EditGroup.class})
    @Min(value = 1)
    @Max(value = 2)
    private Integer type;

    /**
     * 折扣券
     */
    @Excel(name = "折扣")
    private Double discount;

    /**
     * 代金券
     */
    @Excel(name = "代金面额")
    private Double voucher;

    /**
     * 活动状态 0 禁用 1 正常
     */
    @Excel(name = "活动状态", readConverterExp = "0=禁用,1=正常")
    private Integer status;

    /**
     * 开始时间
     */
    @Excel(name = "开始时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @NotNull(message = "请输入开始时间",groups = {CreateGroup.class,EditGroup.class})
    private LocalDateTime beginTime;

    /**
     * 结束时间
     */
    @Excel(name = "结束时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @NotNull(message = "请输入结束时间",groups = {CreateGroup.class,EditGroup.class})
    private LocalDateTime endTime;

    /**
     * 备注信息
     */
    @Excel(name = "备注信息")
    private String remark;

    private Integer delFlag;

    public Long getActivityId() {
        return activityId;
    }

    public void setActivityId(Long activityId) {
        this.activityId = activityId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public Double getVoucher() {
        return voucher;
    }

    public void setVoucher(Double voucher) {
        this.voucher = voucher;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public LocalDateTime getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(LocalDateTime beginTime) {
        this.beginTime = beginTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }
}
